package com.github.pig.sales.mapper;

import com.github.pig.sales.entity.SalesIntentionFlowup;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import feign.Param;

import java.util.Map;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 意向跟进 Mapper 接口
 * </p>
 *
 * @author andrew
 * @since 2018-06-16
 */
public interface SalesIntentionFlowupMapper extends BaseMapper<SalesIntentionFlowup> {

    List<Map<String,Object>> getByStuId(Integer stuId);

    /**
     * 通过用户名查询是否能跟进
     * @param uid 用户id
     * @return int跟进次数
     */
    int getFlagById(@Param("uid")int uid);

    /**
     * 判断跟进率是否合格
     * @param uid 用户id
     * @return
     */
    int getRateById(@Param("uid")int uid);

    /**
     * 通过用户名查询是否能跟进
     * @param uid 用户id
     * @return int跟进次数
     */
    int sFollowUp(@Param("uid")int uid);

    /**
     * 添加跟进信息
     * @param map 用户信息
     * @return int跟进次数
     */
    int add(@Param("map")Map map);
}
